<template>
  <water-mark content="Admin Pro" :disabled="true">
    <left-menu-layout v-if="layout === 'left'" key="leftmenu-layout">
      <slot />
    </left-menu-layout>
    <basic-layout v-else key="basic-layout">
      <slot />
    </basic-layout>
  </water-mark>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { injectMenuState } from './use-menu-state';
import BasicLayout from './basic-layout.vue';
import LeftMenuLayout from './leftmenu-layout.vue';

export default defineComponent({
  name: 'GlobalLayout',
  components: {
    BasicLayout,
    LeftMenuLayout,
    WaterMark: defineAsyncComponent(() => import('@/components/watermark/index.vue'))
  },
  setup() {
    return {
      ...injectMenuState()
    };
  }
});
</script>
